<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="utf-8">
    <meta name="full-screen" content="yes">
    <meta name="x5-fullscreen" content="true">
    <meta name="viewport" content="width=device-width,initial-scale=1.0,user-scalable=no">
    <link rel="stylesheet" href="../../css/base.css">
    <link rel="stylesheet" href="../../css/icon-font.css"/><!--图标-->
    <link rel="stylesheet" href="../../css/info-list.css"/><!--资讯列表-->
    <link rel="stylesheet" href="../../css/report-list.css"/><!--研报列表-->
    <link rel="stylesheet" href="../../plugin/mescroll/css/mescroll.min.css">

    <title>搜索</title>
    <style>

        em {
            color: #2C68FF;
            font-style: initial;
        }

        .index-search-wrap {
            padding: .12rem .32rem;
            background: rgba(255, 255, 255, 1);
        }

        .index-search-img {
            width: 7.5rem;
            height: 3rem;
        }

        .index-search-img img {
            width: 100%;
            height: 100%;
        }

        .index-search-search {
            height: .64rem;
            line-height: .64rem;
            width: 6.08rem;
            border-radius: .08rem;
            background: rgba(245, 245, 245, 1);
        }

        .index-search-icon {
            margin-left: .24rem;
            color: rgba(159, 159, 159, 1);
        }

        .index-search-sc {
            color: rgba(159, 159, 159, 1);
            height: .64rem;
            width: .92rem;
            line-height: .64rem;
            margin: auto;
            text-align: center;
        }


        .index-search-search i {
            margin-right: .26rem;
        }

        .index-search-search input {
            margin-left: .14rem;
            line-height: .6rem;
        }

        input[type=search]::-webkit-search-cancel-button {
            -webkit-appearance: none;
        }

        .index-search-cancle {
            color: rgba(44, 104, 255, 1);
        }

        /*************菜单选择器**开始**************/
        .search-inside-warp {
            height: 0.72rem;
            z-index: 5000;
            border-bottom: solid 1px #f6f6f6;
        }

        .search-inside-warp .search-inside-column {
            height: 0.72rem;
            white-space: nowrap;
            width: 100%;
        }

        .search-inside-warp .search-inside-column .search-inside-item {
            height: 0.72rem;
            line-height: 0.72rem;
            margin: 0 0.32rem;
            color: rgba(34, 34, 34, 0.45)
        }

        .search-inside-warp .search-inside-column .search-inside-item .search-inside-underline {
            width: 100%;
            bottom: .04rem;
        }

        .search-inside-warp .search-inside-column .search-inside-item .search-inside-underline span {
            width: .36rem;
            background: rgba(44, 104, 255, 1);
            border-radius: .04rem;
        }

        .search-inside-warp .search-inside-column .search-inside-item .search-inside-underline .underactive {
            height: .06rem;
        }

        .search-inside-warp .search-inside-column .active {
            color: rgba(44, 104, 255, 1);
            font-weight: bold;
        }

        .search-inside-warp .inside-inside-traneara {
            width: .4rem;
            height: .88rem;
            right: 1.08rem;
            background: linear-gradient(270deg, rgba(255, 255, 255, 1) 0%, rgba(255, 255, 255, 0) 100%);
        }


        .search-inside-warp .inside-inside-lefteara {
            width: .4rem;
            height: .88rem;
            left: 0;
            z-index: 11;
            background: linear-gradient(270deg, rgba(255, 255, 255, 0) 0%, rgba(255, 255, 255, 1) 100%);
        }

        .search-inside-warp .column-img {
            width: .64rem;
            height: 0.72rem;
            /*margin-top: 0.14rem;*/
            margin-left: 0.44rem;
        }

        .search-inside-warp .column-img span {
            margin-left: 0;
        }


        /*************菜单选择器**结束**************/


        /*************综合 应用**开始**************/
        .comp-search-wrap {
        }

        .comp-app-model {
            padding: 0 .32rem;
            height: .78rem;
            line-height: .78rem;
            color: rgba(34, 34, 34, 1);
            border-bottom: 1px solid #F2F2F2;
        }

        .comp-app-box {
            padding: 0 .24rem .06rem .24rem;
        }

        .comp-app-item {
            width: 1.4rem;
            padding-top: .2rem;
        }

        .comp-app-item div {
            color: #222222;
            margin-top: .16rem;
            margin-bottom: .2rem;
        }

        .comp-app-item img {
            width: .6rem;
            height: .6rem;
            border-radius: .22rem;
        }

        .comp-show-wrap {
            height: .78rem;
            color: rgba(34, 34, 34, 0.5);
        }

        .comp-show-desc span {
            color: #2C68FF;
        }

        .comp-show-icon {
            margin-left: .08rem;
            line-height: .78rem;
        }

        .comp-data-list {
            padding: 0 .32rem;
        }
        .comp-data-list div:last-child {
            border-bottom: none;
        }

        .data-data-list {
            padding: 0 .32rem;
        }

        .comp-data-item {
            color: #222222;
            height: .84rem;
            border-bottom: 1px solid #f6f6f6;
        }

        .comp-data-title span {
            color: #2C68FF;
        }

        .comp-data-btn {
            width: .8rem;
            height: .4rem;
            line-height: .4rem;
            background: rgba(244, 245, 249, 1);
            border-radius: 2px;
            text-align: center;
            color: #2C68FF;
        }

        .comp-video-list {
            padding: 0 0.32rem;
        }
        .comp-video-list div:last-child {
            border: none;
        }

        .featured-video-item {
            padding: 16px 0;
            border-bottom: 1px solid #f6f6f6;
        }

        .featured-video-item-img-wrap {
            position: relative;
            width: 2.8rem;
            height: 1.6rem;
        }

        .featured-video-item-img {
            width: 2.8rem;
            height: 1.6rem;
        }

        .featured-video-item-img img {
            width: 100%;
            height: 100%;
            border-radius: 4px;
        }

        .featured-video-item-time {
            position: absolute;
            top: 1.2rem;
            right: 0.1rem;
        }

        .featured-video-item-time div {
            background-color: rgba(0, 0, 0, 0.25);
            color: rgba(255, 255, 255, 0.8);
            padding: 1px 4px;
        }

        .featured-video-item-content {
            height: 1.6rem;
        }

        .featured-video-item-bottom {
            color: rgba(34, 34, 34, 0.45)
        }

        .featured-video-item-icon {
            color: #B9B9B9;
        }

        /*************综合 应用**结束**************/


        /*************快讯 **开始**************/
        .search-list-wrap3 {
            padding: 0 .32rem;
        }

        .index-new-item {
            padding: .36rem 0;
            border-bottom: solid 1px #f6f6f6;
        }

        .index-new-title {
            color: rgba(34, 34, 34, 1);
            line-height: .48rem;
        }

        .index-new-time {
            line-height: .34rem;
            color: rgba(34, 34, 34, 0.7);
            margin-top: .2rem;
        }

        .index-new-quit {
            background: rgba(247, 248, 249, 1);
            padding: .18rem .24rem .3rem .24rem;
            line-height: .42rem;
            color: rgba(34, 34, 34, 0.7);
            margin-top: .24rem;
        }

        .index-flash-img {
            margin-top: .24rem;
        }

        .index-flash-img img {
            width: 3.2rem;
            height: 1.8rem;

        }

        .index-flash-track-list {
            position: relative;
        }

        .index-flash-track-list .index-flash-track-ul {
            padding-inline-start: 0.2rem;
            margin-right: 0.32rem;
        }

        .index-flash-track-list .index-flash-track-li {
            position: relative;
            padding: 0.12rem 0 0.4rem 0.18rem;
            line-height: 0.48rem;
            border-left: 1px solid #F0F0F0;
        }

        .index-flash-track-list .index-flash-track-li .node-icon {
            position: absolute;
            left: -0.10rem;
            top: 0.24rem;
            width: 0.18rem;
            height: 0.18rem;
            border: 2px solid #2C68FF;
            background-color: white;
            border-radius: 50px;
        }

        .index-flash-track-list .index-flash-track-li .time {
            margin-right: 0.32rem;
            position: relative;
            top: -0.04rem;
            display: inline-block;
            vertical-align: middle;
            color: rgba(34, 34, 34, 0.7);
        }

        .index-flash-track-list .index-flash-track-li .title {
            display: inline-block;
            vertical-align: middle;
            color: #222222;
        }

        .index-flash-track-list .content {
            margin-top: 0.24rem;
            padding: 0.18rem 0.24rem;
            background-color: #F7F8F9;
            color: rgba(34, 34, 34, 0.7);
            line-height: 0.42rem;
        }

        .index-flash-track-list .content span {
            color: #FF9523;
        }

        /*************快讯 **结束**************/

        .abs-list-tb {
            width: 100%;
            padding: 0 .32rem;
        }

        .search-industry-list {
            flex-wrap: wrap;
            display: flex;
            padding: 0 .18rem .2rem .18rem;
            border-bottom: solid 1px #f6f6f6;
        }

        .research-industry-item {
            width: 2.1rem;
            height: 1.64rem;
            background: rgba(253, 253, 253, 1);
            border-radius: 4px;
            margin: .2rem .14rem 0 .14rem;
            border: 1px solid rgba(240, 240, 240, 1);
        }

        .research-industry-item img {
            width: .64rem;
            height: .64rem;
            margin-bottom: .04rem;
        }

        .research-industry-item div {
            line-height: .4rem;
            width: 100%;
            text-align: center;
        }


        .search-stock-list {
            background: rgba(255, 255, 255, 1);
            padding: 0 .32rem;
        }

        .research-stock-item {
            padding: .2rem 0;
            border-bottom: 1px solid #f6f6f6;
        }

        .research-stock-icon {
            color: rgba(0, 0, 0, 1);
        }

        .research-stock-title {
            line-height: .4rem;
            color: rgba(34, 34, 34, 1);
            margin-left: .2rem;
        }

        .topic-industry-list {
            padding: 0 .32rem;
        }
        .topic-industry-list div:last-child {
            border-bottom: none;
        }

        .topic-industry-item {
            border-bottom: solid 1px rgba(242, 242, 242, 1);
            height: .84rem;
            line-height: .84rem;
        }

        .topic-industry-name {
            color: #222222;
        }

        .topic-industry-name span {
            color: #2C68FF;
        }

        .topic-industry-btn {
            color: rgba(34, 34, 34, 0.5);
        }

        .topic-industry-btn span {
            margin-left: .08rem;
        }

        .comp-market-list {
            padding: 0 .32rem;
        }
        .comp-market-list div:last-child {
            border: none;
        }

        .comp-market-item {
            height: .96rem;
            border-bottom: solid 1px #f6f6f6;
            line-height: .36rem;
        }

        .comp-market-base {
            color: rgba(34, 34, 34, 1);
        }

        .comp-market-per {
            width: 1.64rem;
            text-align: right;
        }

        .comp-market-perrose {
            color: rgba(239, 66, 68, 1);
        }

        .comp-market-perfall {
            color: rgba(22, 178, 112, 1);
        }

        .comp-market-address {
            width: .38rem;
            height: .24rem;
            /*line-height: .24rem;*/
            border-radius: 2px;
            text-align: center;
        }

        .comp-market-addressSZ {
            background: rgba(78, 126, 244, 1);
            color: rgba(255, 255, 255, 1);
        }

        .comp-market-addressSH {
            background: rgba(239, 66, 68, 1);
            color: rgba(255, 255, 255, 1);
        }

        .comp-market-code {
            color: rgba(34, 34, 34, 0.6);
            line-height: .32rem;
            margin-left: .06rem;
        }

        .no-more-data {
            text-align: center;
            width: 100%;
            height: .88rem;
            line-height: .88rem;
            color: rgba(34, 34, 34, 0.5);
        }


        .abs-list-search-item {
            padding: 0.26rem 0.32rem;
            border-bottom: 1px solid #f6f6f6;
            color: #222222;
        }

        .abs-list-no {
            height: 3rem;
            background-color: #f6f6f6;
            padding-top: 2rem;
        }

        .abs-list-no-img {
            height: 1.92rem;
            width: 5.2rem;
        }

        .abs-list-no-img img {
            height: 100%;
            width: 100%;
        }

        .abs-list-no-tip {
            color: rgba(34, 34, 34, 0.7);
        }

    </style>
</head>
<body>

<div class="flex-column h-100-p ff400">

    <div class="placeholder-top">
        <!--状态栏-->
        <div class="bg-main status-bar"></div>

        <!--搜索框-->
        <div class="index-search-wrap">
            <div class="flex-row justify-content-between align-items-center index-search-box">
                <div class="flex-row justify-content-between align-items-center index-search-search">
                    <div class="flex-row align-items-center w-100-p">
                        <span class="iconfont iconsousuo-01 fs16 index-search-icon"></span>
                        <form action="" onsubmit="return false;" class="w-100-p">
                            <input class="flex-row align-items-center w-100-p ml10 fs14" autofocus="autofocus" type="search" id="keyWord" placeholder="请输入您感兴趣的内容">
                        </form>
                    </div>
                    <span class="iconfont iconshanchu fs16 index-search-sc" onclick="cancleDel()"></span>
                </div>
                <div class="index-search-cancle fs14 ff400" onclick="clickBack()">取消</div>
            </div>
        </div>
    </div>

    <!--二级菜单栏目选择器-->
    <div class="flex-row bg-white search-inside-warp">
        <div class="flex-row justify-content-between search-inside-column"></div>
    </div>

    <div class="flex-1 scroll-y">
        <!--综合-->
        <div class="mescroll" id="mescroll0">
            <div class="flex-column search-list-wrap search-list-wrap1" id="dataList0">
                <!--应用-->
                <div class="comp-app-wrap bg-white mb10 dis-n">
                    <div class="comp-app-model ff500 fs14">应用</div>
                    <div class="flex-row flex-wrap comp-app-box"></div>
                </div>

                <!--资讯-->
                <div class="comp-info-wrap bg-white dis-n mb10">
                    <div class="comp-app-model ff500 fs14">资讯</div>
                    <div class="comp-info-list bg-white"></div>
                </div>

                <!--数据-->
                <div class="comp-data-wrap bg-white dis-n mb10">
                    <div class="comp-app-model ff500 fs14">数据</div>
                    <div class="comp-data-list"></div>
                </div>

                <!--行情-->
                <div class="comp-market-wrap bg-white dis-n mb10">
                    <div class="comp-app-model ff500 fs14">行情</div>
                    <div class="comp-market-list"></div>
                </div>

                <!--京东研究-->
                <div class="comp-research-wrap bg-white dis-n mb10">
                    <div class="comp-app-model ff500 fs14">京东研究</div>
                    <div class="comp-research-list"></div>
                </div>

                <!--JT²云课-->
                <div class="comp-video-wrap bg-white dis-n mb10">
                    <div class="comp-app-model ff500 fs14">JT²会客厅</div>
                    <div class="comp-video-list"></div>
                </div>
            </div>
        </div>

        <!--资讯-->
        <div class="mescroll dis-n" id="mescroll1">
            <div class="flex-column search-list-wrap bg-white " id="dataList1"></div>
        </div>

        <!--快讯-->
        <div class="mescroll dis-n" id="mescroll2">
            <div class="flex-column search-list-wrap search-list-wrap3 bg-white" id="dataList2"></div>
        </div>

        <!--数据-->
        <div class="mescroll dis-n" id="mescroll3">
            <div class="flex-column search-list-wrap search-list-wrap4" id="dataList3">

                <!--数据-->
                <div class="comp-data-wrap bg-white dis-n mb10">
                    <div class="comp-app-model ff500 fs14">数据</div>
                    <div class="data-data-list"></div>
                </div>

                <!--ABS报价-->
                <div class="data-abs-wrap bg-white dis-n mb10">
                    <div class="comp-app-model ff500 fs14">ABS报价</div>
                    <div class="data-abs-list"></div>
                </div>
            </div>
        </div>

        <!--研究-->
        <div class="mescroll dis-n" id="mescroll4">
            <div class="flex-column search-list-wrap search-list-wrap5" id="dataList4">

                <!--投研深度专题-->
                <div class="research-topic-wrap bg-white mb10 dis-n">
                    <div class="comp-app-model ff500 fs14">投研深度专题</div>
                    <div class="topic-industry-list"></div>
                </div>

                <!--产业链图谱-->
                <div class="research-map-wrap bg-white dis-n mb10">
                    <div class="comp-app-model ff500 fs14">产业链图谱</div>
                    <div class="search-industry-box">
                    </div>
                </div>

                <!--京东研究-->
                <div class="research-research-wrap bg-white dis-n mb10">
                    <div class="comp-app-model ff500 fs14">京东研究</div>
                    <div class="search-research-list"></div>
                </div>

                <!--语音研报-->
                <div class="research-stock-wrap bg-white dis-n mb10">
                    <div class="comp-app-model ff500 fs14">语音研报</div>
                    <div class="search-stock-list"></div>
                </div>
            </div>
        </div>
    </div>

</div>

</body>
<!--这四个文件的引入必须按照顺序-->
<script src="../../js/dict.js"></script>
<script src="../../js/jquery-3.4.1.min.js"></script>
<script src="../../js/checkJsBridge.js"></script>
<script src="../../js/utils.js"></script>
<script src="../../js/api.js"></script>
<!--这四个文件的引入必须按照顺序-->
<script src="../../js/date.js"></script>
<script src="../../js/icon-font.js"></script><!--用于彩色字体图标-->
<script src="../../js/template.js"></script>

<!--protobuf-->
<script src="../../js/protobuf.min.js"></script>
<script src="../../js/proto.js"></script>

<script src="../../plugin/mescroll/js/mescroll.min.js"></script>

<script>
  let mescrollArr = new Array(5)//4个菜单所对应的4个mescroll对象
  let pm = {
    keyWord: '',
    oldKeyWord: '',
    currCode: '0',
    stockList: [],
    dataFlag: '',
    noDataFlag: '',
    isLogin: false,
    quotationsInteface: '/jtzx/ficc/abs/quotations'
  }

  function initPage(params) {
    //状态栏自适应
    Utils.sbhAdaptive()

    pm.isLogin = !user.isGuest

    pm.keyWord = decodeURIComponent(params.key)
    pm.oldKeyWord = decodeURIComponent(params.key)
    pm.currCode = params.type ? params.type : pm.currCode

    $('#keyWord').val(pm.keyWord)

    document.onkeydown = function (event) {
      pm.keyWord = $('#keyWord').val()
      if (event.keyCode === 13 && pm.keyWord) {//回车键的键值为13
        asemblyPage(pm.currCode)
        goSearch()//回车需执行的方法
      }
    }

    document.oninput = function (event) {
      if ($('#keyWord').val()) {
        $('.index-search-sc').show()
      } else {
        $('.index-search-sc').hide()

        jsBridge.goBack({
          isDelete: true
        })
      }
    }

    pm.quotationsInteface = pm.isLogin ? '/jtzx/ficc/abs/user-quotations' : '/jtzx/ficc/abs/quotations'

    //初始化二级菜单
    dealMenuInside()

    //下拉刷新、滚动加载
    initScroll(pm.currCode)

    pageScroll()

  }

  function startPage(params) {
    //研报专题列表刷新
    $('.readCnt_' + params.infoId).html(params.readCnt)
    $('.commentCnt_' + params.infoId).html(params.commentCnt)
  }

  function initScroll(type) {
    if (type === '1' || type === '2') {
      mescrollArr[type] = Template.createMeScroll({
        id: 'mescroll' + type, //区域ID
        pageNum: 1,
        downCallback: reLoadPage, //下拉刷新入口
        upCallback: upCallback//滚动加载入口
      })
    } else {
      mescrollArr[type] = Template.createNoScroll({
        id: 'mescroll' + type, //区域ID
        pageNum: 1,
        downCallback: reLoadPage//下拉刷新入口
      })
    }
  }

  function reLoadPage() {
    pm.isLogin = !user.isGuest
    //初始化组装二级菜单参数对象
    asemblyPage(pm.currCode)

    //刷新后，调用当前页数据查询
    goSearch(pm.currCode)

  }

  function upCallback() {
    if (pm.currCode === '1') {
      //搜索资讯列表
      goInfoSearch(pm.currCode)
    } else if (pm.currCode === '2') {
      //搜索快讯、快评列表
      goNewsSearch(pm.currCode)
    }
  }

  //初始化二级菜单
  function dealMenuInside() {
    let list = [
      {funcName: '综合', funcCode: '0'},
      {funcName: '资讯', funcCode: '1'},
      {funcName: '快讯', funcCode: '2'},
      {funcName: '数据', funcCode: '3'},
      {funcName: '研究', funcCode: '4'},
    ]

    let htmlStr = ''

    $.each(list, function (i, it) {
      let flag = false
      if (pm.currCode && i === parseInt(pm.currCode)) {
        flag = true
        //处理从其他页面跳转过来时的显隐
        $('.mescroll').hide()
        $('#mescroll' + pm.currCode).show()
      }
      htmlStr += '       <div class="ff400 fspx14 search-inside-item search_' + it.funcCode + ' pos-r ' + (flag ? ' active ' : '') + ' " onclick="changeColumn(\'' + it.funcCode + '\', \'' + i + '\')">\n' +
            '                <span>' + it.funcName + '</span>\n' +
            '                <span class="flex-row justify-content-center search-inside-underline pos-a">\n' +
            '                    <span class=\'' + (flag ? 'underactive' : '') + '\'></span>\n' +
            '                </span>\n' +
            '            </div>'

      //初始化参数
      asemblyPage(it.funcCode)
    })

    $('.search-inside-column').html(htmlStr)

    //菜单初始化完成后，调用首页数据查询，由下拉刷新插件完成
  }

  //初始化组装二级菜单对象
  function asemblyPage(funcCode) {
    pm[funcCode] = {
      pageNum: 1,
      pageSize: 10,
      scrollHeight: 0,
      isPerform: false,//记录点击菜单后，是否已经执行查询操作
      lastDttm: DateUtils.getNowInt()
    }
  }

  //X按钮，去除输入信息
  function cancleDel() {
    pm.keyWord = ''
    $('#keyWord').val(pm.keyWord)
    $('.index-search-sc').hide()

    jsBridge.goBack({
      isDelete: true
    })
  }

  //改变顶部菜单
  function changeColumn(funcCode, ind) {
    pm.currCode = funcCode
    $('.mescroll').hide()
    $('#mescroll' + ind).show()

    $('.search-inside-warp .search-inside-column .search-inside-item').removeClass('active')
    $('.search_' + funcCode).addClass('active')
    $('.search-inside-warp .search-inside-column .search-inside-item .search-inside-underline span').removeClass('underactive')
    $('.search_' + funcCode).find('span').addClass('underactive')

    $('.mescroll').animate({scrollTop: pm[funcCode].scrollHeight}, 500)//动画效果

    //首次点击菜单是执行查询操作
    if (!pm[pm.currCode].isPerform || pm.keyWord !== pm.oldKeyWord) {
      initScroll(ind)
      //菜单初始化完成后，调用首页数据查询，由下拉刷新插件完成
    } else {
      //每次切换tab时，重新加载
      goSearch(pm.currCode)
    }
  }

  //校验是否有数据
  function hasMoreDataCheck(htmlStr, pcls, method, total) {

    let str = ''
    if (!htmlStr) {
      $('.' + pcls).hide()
    } else {
      $('.' + pcls).show()
      if (total > 3) {
        str =
              ' <div class="flex-row justify-content-center align-items-center comp-show-wrap" onclick="' + method + '()">\n' +
              '                    <div class="comp-show-desc fs13 ff400">查看全部\n' +
              '                        <span class="comp-info-cnt">' + total + '</span>\n' +
              '                        条内容\n' +
              '                    </div>\n' +
              '                    <span class="iconfont iconfanhui fs11 comp-show-icon"></span>\n' +
              '                </div>'
      }
    }
    return str
  }

  //搜索入口
  function goSearch(funcCode) {
    funcCode = funcCode ? funcCode : pm.currCode
    pm.currCode = funcCode
    pm[pm.currCode].isPerform = true

    pm.keyWord = $('#keyWord').val()

    if (funcCode === '1' || funcCode === '2' || funcCode === '3') {
      if (funcCode === '1') {
        //搜索资讯列表
        goInfoSearch(pm.currCode)
      } else if (funcCode === '2') {
        //搜索快讯、快评列表
        goNewsSearch(pm.currCode)
      } else if (funcCode === '3') {
        //搜索数据模块数据-搜索BAS报价
        goDataSearch(pm.currCode)
      }
    } else {
      if (funcCode === '0') {
        getCompSearchList(pm.currCode)
      } else if (funcCode === '4') {
        goResearchSearch(pm.currCode)
      }
    }

    //搜索词缓存
    if (pm.keyWord) {
      Template.searchWordCache(pm.keyWord)
    }
  }

  //综合搜索
  function getCompSearchList() {
    //根据请求设置
    pm.noDataFlag = 'aaaaaa'
    pm.dataFlag = ''

    //搜索应用
    getApplicationInfoByName()

    //搜索资讯列表
    getInfoListSearchByEs()

    //搜索数据图表
    getDataSearchTable()

    //搜索股票行情信息
    getSecuritiesInfo()

    //搜索研报列表
    getInfoListForSearch()

    //搜索精选视频列表
    getInfoListForVoide()
  }

  //搜索应用
  function getApplicationInfoByName() {
    Server.search.getApplicationInfoByName({
      searchWord: pm.keyWord
    }).then(function (data) {

      let htmlStr = ''
      $.each(data.data, function (i, item) {
        htmlStr +=
              '            <div class="flex-column align-items-center comp-app-item" onclick="goChaildPage(\'' + item.pageUrl + '\',\'' + item.name + '\')">\n' +
              '                <img src="' + item.iconUrl + '" alt="">\n' +
              '                <div class="ff400 fs12 line1">' + Utils.dealKeyWord(item.name, pm.keyWord) + '</div>\n' +
              '            </div>'
      })

      //设置综合搜索区域数据
      comDataSet(htmlStr, 'comp-app-wrap', 'comp-app-box')

    }).catch((error) => {
      mescrollArr[0].endErr()
    })
  }

  //设置综合搜索区域数据
  function comDataSet(htmlStr, modelCls, dataCls) {
    //通过示范有数据，设置模块是否显隐
    if (!htmlStr) {
      $('.' + modelCls).hide()
      pm.dataFlag += 'a'
    } else {
      //设置
      $('.' + modelCls).show()
      $('.' + dataCls).html(htmlStr)
    }

    //下拉刷新结束回调
    if (pm.dataFlag === pm.noDataFlag) {
      mescrollArr[0].endSuccess(0, false)
    } else {
      mescrollArr[0].endSuccess()
    }
  }

  //跳转应用页面
  function goChaildPage(pageUrl, name) {
    if (pageUrl && pageUrl === 'native/index-info.html') {//走原生跳转
      jsBridge.openIndexPage({
        pageUrl: 'index-info.html',
        method: 'homePageIn',
        fcode: '004001'
      })
    } else {
      jsBridge.openWindow(pageUrl, {}, {noBar: false})
    }
  }

  //搜索资讯列表
  function getInfoListSearchByEs() {
    Server.search.getInfoListSearchByEs({
      pageNo: 1,
      pageSize: 5,
      infoType: '1,3,9',
      pid: 'JT2_APP',
      searchWord: pm.keyWord
    }).then(function (data) {
      let htmlStr = ''
      if (data.data !== null) {
        pm.stockList = []
        $.each(data.data, function (i, item) {
          if (i < 3) {
            //处理分隔线
            htmlStr += Template.dealInfo(item)
            if (i < data.data.length - 1) {
              htmlStr += '<div class=\'info-list-topborder\'></div>'
            }
          }
        })

        htmlStr += hasMoreDataCheck(htmlStr, 'comp-info-wrap', 'goInfo', data.total)

      }

      //设置综合搜索区域数据
      comDataSet(htmlStr, 'comp-info-wrap', 'comp-info-list')
      Template.stockRise()


    }).catch((error) => {
      mescrollArr[0].endErr()
    })
  }

  //跳转到资讯搜索页签
  function goInfo() {
    changeColumn('1', '1')
  }

  //搜索数据图表
  function getDataSearchTable() {
    Server.search.getDataSearchTable({
      pageNum: 1,
      pageSize: 3,
      key: pm.keyWord
    }).then(function (data) {
      let htmlStr = ''
      if (data.dataList !== null) {
        $.each(data.dataList, function (i, item) {
          //处理分隔线
          Utils.dealKeyWord(item.name, pm.keyWord)
          htmlStr +=
                '    <div class="flex-row justify-content-between align-items-center comp-data-item" onclick="goTableDetail(\'' + item.chartsCode + '\', \'' + item.title + '\')">\n' +
                '        <div class="comp-data-title flex-1 fs14 ff500 line1">' + Utils.dealKeyWord(item.title, pm.keyWord) + '</div>\n' +
                //'        <div class="comp-data-btn">+</div>\n' +
                '    </div>'
        })

        htmlStr += hasMoreDataCheck(htmlStr, 'comp-data-wrap', 'goSearchTable', data.total)

      }

      //设置综合搜索区域数据
      comDataSet(htmlStr, 'comp-data-wrap', 'comp-data-list')

    }).catch((error) => {
      mescrollArr[0].endErr()
    })
  }

  function goTableDetail(code, title) {
    jsBridge.openWindow('html/data/table-detail.html?menuCode=' + code + '&appName=' + title, {}, {noBar: false})
  }

  //跳转到图表搜索页面
  function goSearchTable() {
    let key = $('#keyWord').val()
    key = key ? encodeURIComponent(Utils.replaceAll(key, '%', '%25')) : ''
    jsBridge.openWindow('html/search/search-charts.html', {key: key, title: '数据'}, {noBar: false})
  }

  //搜索股票行情信息
  function getSecuritiesInfo() {
    Server.search.getSecuritiesInfo({
      keyWords: pm.keyWord,
      pageNum: 1,
      pageSize: 20,
      ticket: 'info_pc',
      //markets: ['SH', 'SZ']
    }).then(function (data) {
      let htmlStr = ''
      let map = {}
      if (data.quoteInfo && data.quoteInfo.length > 0) {
        data.quoteInfo.forEach(function (item) {
          map[item.uniqueCode] = item
        })
      }
      if (data.securitiesInfo && data.securitiesInfo.length > 0) {
        data.securitiesInfo.forEach(function (item, i) {
          if (i < 3) {
            let obj = item.uniqueCode.split('-')
            let raisePercent = map[item.uniqueCode] && map[item.uniqueCode].raisePercent ? (Utils.numberFormat(map[item.uniqueCode].raisePercent * 100, 1) + '%') : '-'
            let lclass
            if (map[item.uniqueCode] && map[item.uniqueCode].raisePercent) {
              if (map[item.uniqueCode].raisePercent > 0) {
                lclass = 'comp-market-perrose'
              } else if (map[item.uniqueCode].raisePercent < 0) {
                lclass = 'comp-market-perfall'
              }
            }
            let lastPrice = map[item.uniqueCode] && map[item.uniqueCode].lastPrice ? Utils.numberFormat(map[item.uniqueCode].lastPrice) : '-'
            htmlStr += '<div class="flex-row justify-content-between align-items-center comp-market-item" onclick="jumpStock(\'' + item.uniqueCode + '\')">\n' +
                  '                        <div class="flex-column">\n' +
                  '                            <div class="fs13">' + Utils.dealKeyWord(item.name, pm.keyWord) + '</div>\n' +
                  '                            <div class="flex-row align-items-center">\n' +
                  '                                <div class="flex-row align-items-center justify-content-center comp-market-address comp-market-addressSZ ff400 fs10">' + obj[0] + '</div>\n' +
                  '                                <div class="comp-market-code ff400 fs11">' + Utils.dealKeyWord(item.code, pm.keyWord) + '</div>\n' +
                  '                            </div>\n' +
                  '                        </div>\n' +
                  '                        <div class="flex-row">\n' +
                  '                            <div class="comp-market-base fs14 ff600">' + lastPrice + '</div>\n' +
                  '                            <div class="comp-market-per ' + lclass + ' fs14 ff600">' + raisePercent + '</div>\n' +
                  '                        </div>\n' +
                  '                    </div>'
          }
        })
      }

      htmlStr += hasMoreDataCheck(htmlStr, 'comp-market-wrap', 'goSearchMarket', data.total)

      //设置综合搜索区域数据
      comDataSet(htmlStr, 'comp-market-wrap', 'comp-market-list')

    }).catch((error) => {
      mescrollArr[0].endErr()
    })
  }

  // 股票跳转 TODO
  function jumpStock(stockCode) {
    let obj = stockCode.split('-')
    goWordDetail({type: 6, exchange: obj[0], stockCode: obj[1]})
  }

  //跳转到股票行情搜索页面
  function goSearchMarket() {
    let key = $('#keyWord').val()
    key = key ? encodeURIComponent(Utils.replaceAll(key, '%', '%25')) : ''
    jsBridge.openWindow('html/search/search-market.html', {key: key, title: '行情'}, {noBar: false})
  }

  //搜索研报列表
  function getInfoListForSearch() {
    Server.search.getInfoListForSearch({
      searchWord: pm.keyWord
    }).then(function (data) {
      let htmlStr = ''
      if (data.data && data.data.length > 0) {
        data.data.forEach(function (item) {
          htmlStr += dealReportList(item)
        })
      }
      htmlStr += hasMoreDataCheck(htmlStr, 'comp-research-wrap', 'goSearchResearch', data.total)

      //设置综合搜索区域数据
      comDataSet(htmlStr, 'comp-research-wrap', 'comp-research-list')

    }).catch((error) => {
      mescrollArr[0].endErr()
    })
  }
  
  function dealReportList(item) {
    let htmlStr = ''
    let jsonStr = JSON.stringify({
      infoId: item.infoId,
      infoType: item.infoType
    })

    htmlStr += '<div class=\'flex-row index-report-list-item w-100-p\' onclick=\'goDetail(' + jsonStr + ')\'>'
    htmlStr += '<div style="width: 100%"><div class=\'flex-column justify-content-between w-100-p\'>'
    htmlStr += '<div class=\'index-report-list-title line2 ff500\'>'
    htmlStr += '<img class="mr5" src=\' https://zzb.jddglobal.com/customer/manager/download/zzb/png/2802aa07-7ebe-49d7-bee0-d871daa7b08f.png \'/>'
    htmlStr += '<span class=\'fs15\'>' + Utils.dealKeyWord(item.mainTitle, pm.keyWord) + '</span>'
    htmlStr += '</div>'
    if (item.trailContent) {
      item.trailContent = item.trailContent.replace(/<[^>]*?>/g, '')
      if (item.trailContent) {
        if (item.trailContent.length > 20) {
          htmlStr += '<div class=\'fs13 index-report-list-tri\'>' + Utils.dealKeyWord(item.trailContent.substring(0, 40), pm.keyWord) + '...<span>查看详情</span></div>'
        } else {
          htmlStr += '<div class=\'fs13 index-report-list-tri\'>' + item.trailContent + '</div>'
        }
      }
    }

    htmlStr += '<div class=\'index-report-list-time flex-row justify-content-between fs12 \'>'
    htmlStr += '<div>' + DateUtils.formatDate(new Date(item.issuerDttm * 1000), 'yyyy-MM-dd') + '</div>'
    htmlStr += '<div><span class="readCnt_' + item.infoId + '">' + (item.readCnt ? item.readCnt : 0) + '</span>阅读 · '
    htmlStr += '<span class="commentCnt_' + item.infoId + '">' + (item.commentCnt ? item.commentCnt : 0) + '</span>点评'
    htmlStr += '</div></div>'
    htmlStr += ' </div>'
    htmlStr += '</div></div>'
    return htmlStr
  }

  //跳转到研报搜索页面
  function goSearchResearch() {
    let key = $('#keyWord').val()
    key = key ? encodeURIComponent(Utils.replaceAll(key, '%', '%25')) : ''
    jsBridge.openWindow('html/search/search-research.html', {key: key, title: '京东研究'}, {noBar: false})
  }

  //搜索精选视频列表
  function getInfoListForVoide() {
    Server.search.getInfoListForVoide({
      searchWord: pm.keyWord
    }).then(function (data) {
      let htmlStr = ''
      data.data.forEach(function (item) {
        let jsonStr = JSON.stringify({
          infoId: item.trainingId,
          infoType: '2',
          resourceType: item.trainingType
        })
        htmlStr += '<div class=\'featured-video-item flex-row\' onclick=\'goDetail(' + jsonStr + ')\'>'
        htmlStr += '<div class=\'flex-row mr15 featured-video-item-img-wrap\'>'
        htmlStr += '<div class=\'featured-video-item-img\'>'
        htmlStr += '<img src="' + item.coverImgUrl + '"/>'
        htmlStr += '</div>'
        htmlStr += '<div class=\'featured-video-item-time flex-row\'>'
        htmlStr += '<div class=\'fspx12\'>' + DateUtils.s2Str(item.videoDuration) + '</div>'
        htmlStr += '</div>'
        htmlStr += '</div>'
        htmlStr += '<div class=\'featured-video-item-content flex-column  flex-1\'>'
        htmlStr += '<div class=\'fspx15 ff500 line2\'>' + Utils.dealKeyWord(item.mainTitle, pm.keyWord) + '</div>'
        htmlStr += '<div class=\'featured-video-item-bottom flex-row justify-content-between align-items-center mtpx15 \'>'
        htmlStr += '<div class=\'fspx13 line1\' style=\'width:2rem;\'>' + Utils.dealKeyWord(item.lecturer, pm.keyWord) + '</div>'
        htmlStr += '<div>'
        htmlStr += '<span class=\'featured-video-item-icon iconfont iconbofangliang-01 mr5\'></span>'
        htmlStr += '<span class="readCnt_' + item.trainingId + '">' + Utils.dealNumber(item.readCnt) + '</span>'
        htmlStr += '</div>'
        htmlStr += '</div>'
        htmlStr += '</div>'
        htmlStr += '</div>'

      })

      htmlStr += hasMoreDataCheck(htmlStr, 'comp-video-wrap', 'goSearchVoide', data.total)

      //设置综合搜索区域数据
      comDataSet(htmlStr, 'comp-video-wrap', 'comp-video-list')

    }).catch((error) => {
      mescrollArr[0].endErr()
    })
  }

  //跳转到云课搜索页面
  function goSearchVoide() {
    let key = $('#keyWord').val()
    key = key ? encodeURIComponent(Utils.replaceAll(key, '%', '%25')) : ''
    jsBridge.openWindow('html/search/search-voide.html', {key: key, title: 'JT²会客厅'}, {noBar: false})
  }

  //搜索资讯列表
  function goInfoSearch(code) {
    Server.search.goInfoSearch({
      pageNo: pm[code].pageNum,
      pageSize: pm[code].pageSize,
      infoType: '1,3,9',
      pid: 'JT2_APP',
      searchWord: pm.keyWord
    }).then(function (data) {
      let htmlStr = '', len = 0
      if (data.data !== null) {
        len = data.data.length
        pm.stockList = []
        $.each(data.data, function (i, item) {
          //处理分隔线
          if (pm[code].pageNum > 1 || i >= 1) {
            htmlStr += '<div class=\'info-list-topborder\'></div>'
          }
          htmlStr += Template.dealInfo(item)
        })

        if (pm[code].pageNum === 1) {
          $('#dataList1').html(htmlStr)
        } else {
          $('#dataList1').append(htmlStr)
        }
        //记录下一次遍历的日期
        pm[code].lastDttm = data.data.lastDttm
        pm[code].pageNum++
        Template.stockRise()
      }

      //下拉刷新结束回调
      mescrollArr[1].endSuccess(data.hasNextPage ? pm[code].pageSize : len, data.hasNextPage)

    }).catch((error) => {
      jsBridge.log(error)
      mescrollArr[1].endErr()
    })
  }

  //搜索快讯、快评列表
  function goNewsSearch(code) {
    Server.search.goNewsSearch({
      pageNo: pm[code].pageNum,
      pageSize: pm[code].pageSize,
      infoType: '7',
      pid: 'JT2_APP',
      searchWord: pm.keyWord
    }).then(function (data) {
      let htmlStr = '', len = 0
      if (data.data) {
        len = data.data.length
        data.data.forEach(function (item, index) {
          htmlStr += dealChildKp(item, index)
        })

        if (pm[code].pageNum === 1) {
          $('.search-list-wrap3').html(htmlStr)
        } else {
          $('.search-list-wrap3').append(htmlStr)
        }

        if (len === pm[code].pageSize) {
          pm[code].pageNum++
        }
      }

      //下拉刷新结束回调
      mescrollArr[2].endSuccess(len, len === pm[code].pageSize)
    })
  }

  //处理快讯、快评
  function dealChildKp(item, ind) {
    let jsonStr = JSON.stringify({
      infoId: item.infoId,
      infoType: item.infoType
    })

    let htmlStr = ''

    htmlStr += '<div class=\'index-new-item flex-column\' onclick=\'goDetail(' + jsonStr + ')\'>\n'

    // 快讯内容
    htmlStr += '<span class=\'index-new-title fspx15 ' + (item.funcCode === '004005001' ? 'line4 ff500' : 'line6 ff400') + '\'>' + Utils.dealKeyWord(Utils.dealUndefined(item.mainTitle), pm.keyWord) + '</span>'
    // 快评内容
    if (item.trailContent && item.trailContent.trim()) {
      let linkInfo = ''
      if (item.trailContent.length > 150) {
        item.trailContent = item.trailContent.substring(0, 150)
        linkInfo = '...<span class=\'fspx13\' style="color: #BA9775">阅读更多</span>'
      }
      let objList = item.trailContent.split('\n')
      htmlStr += '<div class=\'index-new-quit fspx13 ff400\'>'
      for (let i = 0; i < objList.length; i++) {
        if (objList[i]) {
          if (i === objList.length - 1) {
            htmlStr += '<div>' + objList[i] + linkInfo + '</div>'
          } else {
            htmlStr += '<div>' + objList[i] + '</div>'
            htmlStr += '<div class="h-10-p"></div>'
          }
        }
      }
      htmlStr += '</div>'
    }
    // 图片
    if (item.fileList && item.fileList.length > 0) {
      if (1 === item.fileList.length) {
        htmlStr += '<div class=\'index-flash-img flex-row\'>'
        htmlStr += '<img class=\'index-flash-img-one\' src=\'' + item.fileList[0] + '\'/>'
        htmlStr += '</div>'
      } else if (2 === item.fileList.length) {
        htmlStr += '<div class=\'index-flash-img flex-row\'>'
        htmlStr += ' <img class=\'index-flash-img-more mr10\' src=\'' + item.fileList[0] + '\'/>'
        htmlStr += ' <img class=\'index-flash-img-more mr10\' src=\'' + item.fileList[1] + '\'/>'
        htmlStr += '</div>'
      } else {
        htmlStr += '<div class=\'index-flash-img flex-row justify-content-between\'>'
        htmlStr += ' <img class=\'index-flash-img-more\' src=\'' + item.fileList[0] + '\'/>'
        htmlStr += ' <img class=\'index-flash-img-more\' src=\'' + item.fileList[1] + '\'/>'
        htmlStr += ' <img class=\'index-flash-img-more\' src=\'' + item.fileList[2] + '\'/>'
        htmlStr += '</div>'
      }
    }
    // 评论以及分享
    htmlStr += '<div class=\'index-flash-bottom flex-row justify-content-between align-items-center\'>'

    htmlStr += '<span class=\'index-new-time fspx12\'>' + item.issuerDttmStr.substring(0, 16) + '</span>'
    htmlStr += '</div>'
    htmlStr += '</div>'
    return htmlStr
  }

  //搜索数据模块数据-搜索BAS报价
  function goDataSearch() {
    //数据图表
    Promise.all([
      Server.search.goDataSearch({
        pageNum: 1,
        pageSize: 3,
        key: pm.keyWord
      }),
      Server.search.searchByKey({
        commons: {},
        datas: {
          keyWord: pm.keyWord,
          securityType: 'ABS',
          filterExpired: false
        }
      })]).then(([data, data2]) => {
      let htmlStr = '', hasData = false
      if (data.dataList !== null) {
        $.each(data.dataList, function (i, item) {
          //处理分隔线
          htmlStr +=
                '    <div class="flex-row justify-content-between align-items-center comp-data-item" onclick="goTableDetail(\'' + item.chartsCode + '\', \'' + item.title + '\')">\n' +
                '        <div class="comp-data-title flex-1 fs14 ff500 line1">' + Utils.dealKeyWord(item.title, pm.keyWord) + '</div>\n' +
                //'        <div class="comp-data-btn">+</div>\n' +
                '    </div>'
          hasData = true
        })

        htmlStr += hasMoreDataCheck(htmlStr, 'comp-data-wrap', 'goSearchTable', data.total)

        $('.data-data-list').html(htmlStr)
      }

      //ABS报价查询
      hasData = getAbsOffer(data2, hasData)

      if (hasData) {
        //下拉刷新结束回调
        mescrollArr[3].endSuccess()
      } else {
        //下拉刷新结束回调
        mescrollArr[3].endSuccess(0, false)
      }

    })
  }

  function getAbsOffer(data, hasData) {
    pm.keyWord = $('#keyWord').val()
    let htmlStr = '', len = 0
    if (data.data && data.data.length > 0) {
      len = data.data.length
      data.data.forEach(function (item, index) {
        if (index < 3) {
          htmlStr += '<div class=\'abs-list-search-item fs15 line1\' onclick=\'goToDetail("' + item.id + '","' + item.securityName + '")\'>' + Utils.dealKeyWord(item.securityCode + '    ' + item.securityName, pm.keyWord) + '</div>'
        }
      })
      hasData = true
    }

    if (!htmlStr) {
      $('.data-abs-wrap').hide()
    } else if (len > 3) {
      $('.data-abs-wrap').show()
      htmlStr +=
            ' <div class="flex-row justify-content-center align-items-center comp-show-wrap" onclick="goSearchAbs()">\n' +
            '                    <div class="comp-show-desc fs13 ff400">查看全部数据</div>\n' +
            '                    <span class="iconfont iconfanhui fs11 comp-show-icon"></span>\n' +
            '                </div>'
    }

    $('.data-abs-list').html(htmlStr)

    return hasData

  }

  //跳转到ABS 报价搜索页面
  function goSearchAbs() {
    jsBridge.openWindow('html/data/abs-list.html', {key: $('#keyWord').val()}, {noBar: false})
  }

  //跳转到ABS 报价搜索页面
  function goToDetail(id, name) {
    jsBridge.openWindow('html/data/abs-list.html', {id: id, securityName: name}, {noBar: false})
  }

  function goResearchSearch() {
    pm.noDataFlag = 'aa'
    pm.dataFlag = ''

    //搜索投研深度专题
    getIndustryTopicByName()

    //搜索研究模块
    getReportSearch()
  }

  //搜索投研深度专题
  function getIndustryTopicByName() {
    Server.search.getIndustryTopicByName({
      name: pm.keyWord,
      pageSize: 3,
      pageNum: 1
    }).then(function (data) {

      let htmlStr = ''
      if (data.list && data.list.length > 0) {
        $.each(data.list, function (i, item) {
          htmlStr +=
                '                    <div class="flex-row justify-content-between align-items-center topic-industry-item" onclick="goIndustry(\'' + item.topicCode + '\')">\n' +
                '                        <div class="flex-row topic-industry-name fs14 ff400">' + Utils.dealKeyWord(item.name, pm.keyWord) + '</div>\n' +
                '                        <div class="flex-row topic-industry-btn fs13 ff400">\n' +
                '                            <div>进入</div>\n' +
                '                            <span class="iconfont iconfanhui fs11"></span>\n' +
                '                        </div>\n' +
                '                    </div>'
        })

        htmlStr += hasMoreDataCheck(htmlStr, 'research-topic-wrap', 'goIndustryTopic', data.total)
      } else {
        pm.dataFlag += 'a'
      }

      $('.topic-industry-list').html(htmlStr)

      //下拉刷新结束回调
      if (pm.dataFlag === pm.noDataFlag) {
        mescrollArr[4].endSuccess(0, false)
      } else {
        mescrollArr[4].endSuccess()
      }
    })

  }

  function goIndustryTopic() {
    jsBridge.openWindow('html/research/industry-topic.html', {}, {noBar: false})
  }

  function goIndustry(code) {
    jsBridge.openWindow('html/research/industry.html?type=' + code, {}, {noBar: false})
  }

  //搜索研究模块
  function getReportSearch() {
    Server.search.getReportSearch({
      key: pm.keyWord
    }).then(function (data) {

      //产业链
      $('.search-industry-box').html('<div class="search-industry-list"></div>')
      let industryStr = dealDetailList(data.indList)
      $('.search-industry-list').html(industryStr)
      let btnStr = hasMoreDataCheck(industryStr, 'research-map-wrap', 'goIndustrialChain', data.indTotal)
      $('.search-industry-box').append(btnStr)

      //京东研究
      let resStr = ''
      if (data.data && data.data.length > 0) {
        data.data.forEach(function (item) {
          resStr += dealReportList(item)
        })

        resStr += hasMoreDataCheck(resStr, 'research-research-wrap', 'goSearchResearch', data.total)

        $('.search-research-list').html(resStr)
      }

      //语音研报
      let stockStr = ''
      if (data.voiceInfoList && data.voiceInfoList.length > 0) {
        data.voiceInfoList.forEach(function (item) {
          stockStr += '<div class="flex-row research-stock-item align-items-center" onclick=\'goStockDetail("' + item.voiceId + '", "' + item.infoType + '")\'>' +
                '                    <span class="research-stock-icon iconfont iconerji fs16"></span>\n' +
                '                    <div class="research-stock-title fs15 ff400 line1">' + Utils.dealKeyWord(item.title, pm.keyWord) + '</div>\n' +
                '                </div>'
        })
      }

      stockStr += hasMoreDataCheck(stockStr, 'research-stock-wrap', 'goSearchVoice', data.voiceInfoTotal)

      $('.search-stock-list').html(stockStr)

      //下拉刷新结束回调
      if (!(industryStr + resStr + stockStr)) {
        pm.dataFlag += 'a'
      }

      if (pm.dataFlag === pm.noDataFlag) {
        mescrollArr[4].endSuccess(0, false)
      } else {
        mescrollArr[4].endSuccess()
      }
    })
  }

  function dealDetailList(list) {
    let childStr = ''
    $.each(list, function (k, obj) {
      childStr += '<div class="flex-column justify-content-center align-items-center research-industry-item" onclick="goIndustrialDetail(\'' + obj.industrialCode + '\', \'' + obj.industrialName + '\')">\n' +
            '                    <img src="' + obj.coverImgUrl + '">\n\n' +
            '                    <div class="line1">' + Utils.dealKeyWord(obj.industrialName, pm.keyWord) + '</div>\n' +
            '                </div>'
    })

    return childStr
  }

  //跳转到产业链详情
  function goIndustrialDetail(code, name) {
    jsBridge.openWindow('html/research/industrial-detail.html?menuCode=' + code + '&name=' + name, {}, {noBar: false})
  }

  // 跳转产业链搜索页面
  function goIndustrialChain() {
    let key = $('#keyWord').val()
    key = key ? encodeURIComponent(Utils.replaceAll(key, '%', '%25')) : ''
    jsBridge.openWindow('html/search/search-industrialChain.html', {key: key, title: '产业链图谱'}, {noBar: false})
  }

  // 跳转原生音频详情
  function goStockDetail(infoId, infoType) {
    jsBridge.callBridge('openBrsDetail', {infoId: infoId, infoType: infoType})
  }

  function goSearchVoice() {
    let key = $('#keyWord').val()
    key = key ? encodeURIComponent(Utils.replaceAll(key, '%', '%25')) : ''
    jsBridge.openWindow('html/search/search-voice.html', {key: key, title: '语音研报'}, {noBar: false})
  }

  function dealKeyWord(desc) {
    if (desc && pm.keyWord) {
      desc = desc.replace(pm.keyWord, '<em>' + pm.keyWord + '</em>')
    }
    return desc
  }

  //翻页
  function pageScroll() {
    $('.mescroll').scroll(function () {

      pm[pm.currCode].scrollHeight = $(this).scrollTop()//滚动条位置

    })
  }

</script>
</html>
